package com

import (
	model "beergo/app/sys/models"
	"beergo/conf/const/code"
	"beergo/lib/base/controller"
	"github.com/beego/beego/v2/server/web"
)

type UserInfoController struct {
	controller.ContainerController
	UserRepository *model.UserRepository
	UserModel      *model.User
	JsonData       map[string]interface{}
}

func init() {
	web.Router("/user_info", &UserInfoController{}, "*:GetMyInfoAction")
}

func (this *UserInfoController) GetMyInfoAction() {
	find:=this.GetUser()
	if find.Id == 0 {
		this.StopError(code.ErrorAuth,"请登录","")
	}
	this.ReturnSuccess("OK",find)
}